Computer systems are classically defined as having a central processing unit (CPU), memory, and input/output peripheral devices. Recent advances in integrated circuit technology have allowed many of the classical computer functions to be integrated onto a single integrated circuit chip. If the chip includes a central processing unit and some peripheral circuits, it may be termed an "integrated data processor". An example of an integrated data processor is the MC68302 Integrated Multiprotocol Processor available from Motorola, Inc. If the chip also includes some memory, it achieves even greater system integration; such a chip may be termed a "microcontroller" although it is also commonly known by a variety of terms such as microcomputer, embedded controller, and the like. An example of a microcontroller is the MC68HC11 Microcontroller also available from Motorola, Inc. Both integrated data processors and microcontrollers include "glue logic" circuitry known as the system integration module, to integrate the on-chip memory and/or peripheral devices with the CPU.
Because of their high level of integration, integrated data processors and microcontrollers are ideal for applications such as automobile engine controllers, refrigerators, cellular telephones, remote controllers, and the like. In order to develop software while operating in these applications, it is helpful to observe the flow of software. This observation allows detection of software bugs, and is accomplished through a diagnostic mode known generally as background mode. In background mode, the data processor can be single-stepped through a series of software instructions. After each instruction, the contents of the CPU's registers can be examined to determine how the software has affected them. It is also helpful to have the capability to alter the registers to observe the effect that a modification to the software would have on operation.
Typically, the data processor also includes circuitry to detect certain conditions which should cause it to enter background mode. These conditions are generally termed breakpoints. A breakpoint may be detected, for example, by observing the CPU accessing a certain memory location or the data bus conducting a certain data pattern. After detecting a breakpoint, the system integration module forces an exception (such as by signalling an interrupt). In response to the exception, the CPU places important information about its operation on the stack. The stacked information allows the CPU to return to normal operating mode after the end of background mode as if nothing had happened. Thus, entering and exiting background mode is generally transparent to the operation of the application.
However, because the data processor contains other peripherals, ensuring that the CPU returns transparently from background mode by itself is not enough. It is desirable for the whole chip to operate transparently. For example, many data processors contain serial communications modules. These modules transmit and receive data, and interrupt the CPU based on the occurrence of certain conditions such as a character transmitted or received. After the CPU receives the interrupt, it reads a status register to determine which event caused the interrupt.
Normally, the breakpoint circuitry provides a signal indicating entry into background mode. This signal causes the peripheral's clock to be stopped, which usually is sufficient to preserve transparent operation. Occasionally during the debugging process it is also desirable also to examine the state of the peripheral. However, reading the peripheral's status register causes the state of the peripheral to be changed. Upon return to normal operating mode, the peripheral's state is different from the state it had on entering background mode. What is needed, then, is a data processor which ensures transparent operation in background mode by allowing the states of peripherals to be examined without altering them. This problem is met with the present invention, whose features and advantages will be more clearly understood from the following detailed description taken in conjunction with the accompanying drawings.